Avoid Vec::with_capacity(huge) on empty Routes#4556
Avoid Vec::with_capacity(huge) on empty Routes#4556tnull merged 1 commit intolightningdevkit:mainfrom
Vec::with_capacity(huge) on empty Routes#4556Conversation
In generally we consider empty `Route`s bogus garbage and don't always handle them super carefully, but ideally we shouldn't allocate a huge buffer just because someone passes a bogus `Route` to an onion-building utility method. Reported by Jordan Mecom of Block's Security Team Test by Claude Opus 4.6
|
I've assigned @wpaulino as a reviewer! |
|
I've reviewed the entire diff thoroughly. The fix is correct and well-placed. The No issues found. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4556 +/- ##
==========================================
- Coverage 87.01% 86.99% -0.03%
==========================================
Files 163 163
Lines 108682 108706 +24
Branches 108682 108706 +24
==========================================
- Hits 94572 94571 -1
- Misses 11631 11655 +24
- Partials 2479 2480 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
In generally we consider empty
Routes bogus garbage and don't always handle them super carefully, but ideally we shouldn't allocate a huge buffer just because someone passes a bogusRouteto an onion-building utility method.Reported by Jordan Mecom of Block's Security Team
Test by Claude Opus 4.6